package net.comm.file.web.form;

import net.comm.page.PageCtr;

import org.apache.struts.action.*;
import org.apache.struts.upload.FormFile;


public class FilesForm extends ActionForm {

	private static final long serialVersionUID = 1L;
	private static final String KEY_SPLIT = "#,##,#,#,#";

	private String  Sh_ID;	//学校ID
	private int  	F_ID;	//	附件ID
	private String  F_info;	//	附件文件说明
	private String  Folder;	//	附件所在文件夹
	private String  F_name;	//	附件文件名
	private String  F_File2;//	附件文件2   视频文件的截屏图片
	private int  	F_Num;	//	附件被引用次数
	private String  F_Type;	//	文件类型
	private int  	F_Zip;	//	图片压缩情况
	private int  	F_size;	//	附件大小
	private String  Mtime;	//	最后修改日期
	private FormFile  formFile;	//	待上传文件
	
	private int imgWidth;
	private int imgHeight;
	
	public FilesForm() {
		super();
		// TODO Auto-generated constructor stub
		Clear();
	}
	public void Clear() {
		
		Sh_ID = "";			//学校ID		
		F_ID = 0;		//	附件ID
		F_info = "";	//	附件文件说明
		Folder = "";	//	附件所在文件夹
		F_name = "";	//	附件文件名
		F_File2 = "";	//	附件文件2   视频文件的截屏图片
		F_Num = 0;		//	附件被引用次数
		F_Type = "";	//	文件类型
		F_Zip = 0;		//	图片压缩情况
		F_size = 0;	//	附件大小
		Mtime = "";	//	最后修改日期
		formFile = null;	//	待上传文件			
	}
	private String action = "";
	
	/**
	 * 查询当前页主键值串
	 */
	private String key = "";

	/**
	 * 查询上上页主键值串
	 */
	private String lastKey = "";
	

	/**
	 * 分页控制对象
	 */
	private PageCtr page;
	



	public PageCtr getPage() {
		return page;
	}

	public void setPage(PageCtr page) {
		this.page = page;
	}
	
	/**
	 * @param key the key to set
	 */
	public void setKey(String key) {
		this.key = key;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String[] array) {
		if(key != null && key.trim().length() > 0) {
			key = "";
		}
		
		StringBuffer keyBuff = new StringBuffer();
		for (int i = 0; i < array.length; i++) 
		{
			/**
			 * 防止空字符串引起的split方法异常
			 */
			if(array[i] == null || array[i].length() == 0) {
				keyBuff.append(" ");
			} else {
				keyBuff.append(array[i]);
			}
			
			keyBuff.append(KEY_SPLIT);
		}
		
		key = keyBuff.toString();		
	}
	
	/**
	 * 获取lastKey值
	 * @return
	 */
	public String[] lastKey()
	{
		if(lastKey == null || lastKey.trim().length() == 0) {
			return null;
		}
		
		return lastKey.split(KEY_SPLIT);
	}
	
	public String getLastKey() {
		return lastKey;
	}

	public void setLastKey(String lastKey) {
		this.lastKey = lastKey;
	}	

	public String getAction() {
		return action;
	}
	public void setAction(String action) {
		this.action = action;
	}

	public static String getKEY_SPLIT() {
		return KEY_SPLIT;
	}

	public static long getSerialVersionUID() {
		return serialVersionUID;
	}

	public int getF_ID() {
		return F_ID;
	}

	public String getF_info() {
		return F_info;
	}

	public String getFolder() {
		return Folder;
	}

	public String getF_name() {
		return F_name;
	}

	public String getF_Type() {
		return F_Type;
	}

	public int getF_size() {
		return F_size;
	}

	public String getMtime() {
		return Mtime;
	}

	public FormFile getFormFile() {
		return formFile;
	}

	public void setF_ID(int f_id) {
		F_ID = f_id;
	}

	public void setF_info(String f_info) {
		F_info = f_info;
	}

	public void setFolder(String folder) {
		Folder = folder;
	}

	public void setF_name(String f_name) {
		F_name = f_name;
	}

	public void setF_Type(String type) {
		F_Type = type;
	}

	public void setF_size(int f_size) {
		F_size = f_size;
	}

	public void setMtime(String mtime) {
		Mtime = mtime;
	}

	public void setFormFile(FormFile formFile) {
		this.formFile = formFile;
	}

	public String getSh_ID() {
		return Sh_ID;
	}

	public void setSh_ID(String sh_ID) {
		Sh_ID = sh_ID;
	}
	public int getF_Zip() {
		return F_Zip;
	}
	public void setF_Zip(int zip) {
		F_Zip = zip;
	}
	public String getF_File2() {
		return F_File2;
	}
	public int getF_Num() {
		return F_Num;
	}
	public void setF_File2(String file2) {
		F_File2 = file2;
	}
	public void setF_Num(int num) {
		F_Num = num;
	}
	public int getImgWidth() {
		return imgWidth;
	}
	public void setImgWidth(int imgWidth) {
		this.imgWidth = imgWidth;
	}
	public int getImgHeight() {
		return imgHeight;
	}
	public void setImgHeight(int imgHeight) {
		this.imgHeight = imgHeight;
	}

	
}